package com.riant.cert.tool;

import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
 *
 * 换行符javajava去除字符串中的空格、回车、换行符、制表符
 * */
public class StringUtil {
    public static void main(String[] args) {
        System.out.println(StringUtil.replaceBlank("just do it!"));
    }
    public static String replaceBlank(String str) {
        String dest = "";
        if (str!=null) {
            Pattern p = Pattern.compile("\\s*|\t|\r|\n");
            Matcher m = p.matcher(str);
            dest = m.replaceAll("");
        }
        return dest;
    }

}
